import urllib.request, urllib.error
import urllib.parse
url = 'https://blog.csdn.222net/python03011/article/details/130678150'
headers = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36'
}
try:
    req = urllib.request.Request(url=url,headers=headers)
    response = urllib.request.urlopen(req)
    content = response.read().decode('utf-8')
    print(content)
except urllib.error.HTTPError as e:
    print(f"HTTP ERROR {e}")
except urllib.error.URLError as e:
    print(f"HTTP ERROR {e}")